package com.neu.his.user.serviceimpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neu.his.user.entity.User;
import com.neu.his.user.mapper.UserMapper;
import com.neu.his.user.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	@Autowired
	private UserMapper userMapper;

	@Override
	public List<User> getUserList(int page, int count, String keywords, String keywords02, String keywords03) {
		// TODO Auto-generated method stub
		return userMapper.getUserList(page, count, keywords, keywords02, keywords03);
	}

	@Override
	public int getUserCount(String keywords, String keywords02, String keywords03) {
		// TODO Auto-generated method stub
		
		return userMapper.getUserCount(keywords, keywords02, keywords03);
	}

	/*
	 * 通过id批量删除
	 */
	@Override
	public boolean deleteUserByIds(Integer[] ids) {
		// TODO Auto-generated method stub
		int result=userMapper.deleteUserByIds(ids);
		boolean flag = false;
		if (result > 0) {
			flag = true;
		}
		return flag;
	}

	@Override
	public boolean addUser(User user) {
		// TODO Auto-generated method stub
		int add = userMapper.addUser(user);
		boolean flag = false;
		if (add > 0) {
			flag = true;
		}
		return flag;
	}

	@Override
	public boolean updateUser(User user) {
		// TODO Auto-generated method stub
		int update = userMapper.updateUser(user);
		boolean flag = false;
		if (update > 0) {
			flag = true;
		}
		return flag;
	}

	@Override
	public User getUserBean(String keywords, String keywords2) {
		// TODO Auto-generated method stub
		return userMapper.getUserBean(keywords, keywords2);
	}

}
